package org.projectwithoutname.ui.util;

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Text;

public class Separator{
	
	private Text text;
	private Color color;
	private Display display;

	public Separator(Composite parent, int style) {
		display = parent.getDisplay();
		color = new Color(display,0,0,0);
		text = new Text(parent, style);
		text.setBackground(color);
		// TODO Auto-generated constructor stub
	}
	
	public Color getColor(){
		return color;
	}
	
	public void setBounds(int x, int y, int width, int height){
		text.setBounds(x, y, width, height);
	}
	
	public void setBounds(Rectangle rect){
		text.setBounds(rect);
	}
	
	public Rectangle getBounds(){
		return text.getBounds();
	}
	
	
	public void setColor(RGB newColor){
		color = new Color(display, newColor);
		text.setBackground(color);
	}
	
	public Control getControl(){
		return text;
	}

}
